package cn.webrx;

public class Sbu {
    public static void main(String[] args) {
        StringBuilder sbu = new StringBuilder();
        //插入字符串
        sbu.append("aa");
        sbu.insert(0, "java");//javaaa
        sbu.insert(2, 100);//ja100vaaa

        //删除字符串
        sbu.deleteCharAt(1);//j100vaaa
        sbu.insert(1,"a");//ja100vaaa
        sbu.delete(2,5);//javaaa

        //替换
        sbu.replace(4,6,"17");//javaaa  换为 java17
        System.out.println(sbu);
        System.out.println(sbu.reverse());

        //字符串倒序
        String ms = "hello-123456";
        System.out.println(ms);
        System.out.println(new StringBuilder(ms).reverse());
       }
}
